from django.contrib import admin

# Register your models here.

from .models import Terminal, Department, Members, Registration


#https://docs.djangoproject.com/zh-hans/2.0/intro/tutorial07/
class TerminalAdmin(admin.ModelAdmin):
    list_display = ('IP', 'SN', 'MAC','address', 'administrator')


class DepartmentAdmin(admin.ModelAdmin):
    list_display = ('department', 'leader', 'leader_wx_id')

class MembersAdmin(admin.ModelAdmin):
    fields = ['department_id', 'Member', 'Member_wx_id']
    list_display = ('department_id', 'Member', 'Member_wx_id')
    list_filter = ['department_id']

class RegistrationAdmin(admin.ModelAdmin):
    list_display = ('department', 'user', 'terminal', 'start_time', 'end_time')


admin.site.register(Terminal, TerminalAdmin)
admin.site.register(Department, DepartmentAdmin)
admin.site.register(Members, MembersAdmin)
admin.site.register(Registration, RegistrationAdmin)